package com.github.tetrisgame.manager;

import com.github.tetrisgame.model.Block;

public class BlockManager {
    public static final BlockManager defaultManager = new BlockManager();
    private Block previewBlock;
    private Block currentBlock;

    private BlockManager(){}
    public Block getPreviewBlock(int row,int column){
        if (currentBlock == null){
            currentBlock = new Block(row,column);
        }else{
            currentBlock = previewBlock;
        }
        previewBlock = new Block(row,column);
        return previewBlock;
    }
    public Block getPreviewBlock(){
        return previewBlock;
    }
    public Block getCurrentBlock(){
        return currentBlock;
    }
    public void resetPosition(int row,int column){
        currentBlock.setRow(0);
        currentBlock.setColumn(column/2-1);
        previewBlock.setRow(0);
        previewBlock.setColumn(column/2-1);
    }
}
